package com.itheima.sh.controller;

import com.itheima.sh.clients.UserFeignApi;
import com.itheima.sh.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("feign")
public class FeignController {

    @Autowired
    UserFeignApi userFeignApi;  // JDK 动态代理

    @GetMapping("{id}")
    public User queryById(@PathVariable("id") String id){
        return userFeignApi.queryById(id);
    }
}
